<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model.trim="username"/>
      <button @click="Search">Search</button>
    </div>
  </section>
</template>

<script>
    export default {
        name:"v-search",
        data(){
          return {
            username:""
          }
        },
        methods:{
          Search(){
            //触发总线
            this.$bus.$emit("getusername",this.username);
            //清空input
            this.username=""
          }
        }
    }
</script>

<style scoped>

</style>
